<template>
	<view class="detailsBox">
		<view class="box">
			<view class="listBox">
				<view class="top">
					<text>{{list.address}} {{list.typename}}</text>
					<text>{{list.statename}}</text>
				</view>
				<view class="center">
					<view>{{list.content}}</view>
					<image v-for="(item,index) in list.images" :src="IMGBASEURL+item.url" mode="aspectFill"></image>
				</view>
				<view class="bottom">
					<text>{{list.addtime | timeFormat}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getQuestions
	} from '../../api/questions.js'
	import {
		IMGBASEURL,IMGBASEURLS,
	} from '../../utils/config.js'
	import moment from 'moment'
	export default {
		data() {
			return {
				id: 0,
				list: [],
				IMGBASEURL: IMGBASEURLS
			}
		},
		onLoad(e) {
			this.id = e.id
			this.getQuestions()
		},
		filters:{
			timeFormat(val){	
				return moment(val).format("YYYY-MM-DD HH:mm")
			}
		},
		methods: {
			async getQuestions() {
				let data = await getQuestions({
					id: this.id
				})
				console.log(data)
				if (data.errCode == 10000) {
					this.list = data.data
				}
			}
		}
	}
</script>

<style lang="less">
@import '../../static/style/repairsDetails.less';
</style>
